package com.broadengate.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.broadengate.dao.AmmountDao;
import com.broadengate.model.Dailyammount;

public class AmmountDaoImpl extends HibernateDaoSupport implements AmmountDao {
	
	@SuppressWarnings("unchecked")
	public void saveAmmount(Dailyammount dailyammount) {
		getHibernateTemplate().save(dailyammount);
	}
	public void updateAmmount(Dailyammount dailyammount){
		getHibernateTemplate().update(dailyammount);
	}
	
	@SuppressWarnings("unchecked")
	public Dailyammount findDailyammount(String cardNO){
		List<Dailyammount> list = new ArrayList<Dailyammount>();
    	list= getHibernateTemplate().find("from Dailyammount a where a.cardNo='"+cardNO+"'");
		return null!=list && 0!=list.size() ? (Dailyammount)list.get(0) : null;
	}
}
